<?php
/**
 * Author: Administrator
 * Date: 2022/7/22 2:13
 */

namespace DesignPatterns\Structural\Facade;


class Computer
{
    protected $os;
    protected $bios;

    public function __construct(OSInterface $os, BIOSInterface $bios)
    {
        $this->os = $os;
        $this->bios = $bios;
    }

    public function turnOn() {
        $this->bios->execute();
        $this->bios->waitForKeyPress();
        echo $this->bios->launch($this->os);
    }

    public function turnOff() {
        $this->os->halt();
        $this->bios->powerDown();
    }

}